CREATE_TABLE Function

Syntax

Result_Flag as L = create_table(C filename ,C field_list )

Arguments

filename

The file name of the .DBF file to create.

field_list

A CR-LF delimited list of field names in the format: Fieldname, type, width, decimal_places The field types, the single character codes used to represent them, and the valid parameters associated with them are:

Field Type
Type Code and Valid Parameters
Bitmap

Bitmap "B" Fieldname, Field Type

Character

"C" Fieldname, Field Type, Width

Date

"D" Fieldname, Field Type

Exponent

Numeric "E" Fieldname, Field Type

Linked

image "I" Fieldname, Field Type

JPEG

"J" Fieldname, Field Type

Logical

"L" Fieldname, Field Type

Memo

"M" Fieldname, Field Type

Numeric

"N" Fieldname, Field Type, Width , Decimal Width

OLE

"O" Fieldname, Field Type

Rich text memo

"R" Fieldname, Field Type

Time

"T" Fieldname, Field Type

Short Time

"Y" Fieldname, Field Type

Description

Create a new table using a CR-LF delimited list of field names

Discussion

CREATE_TABLE() is a high level Xbasic function to create a new table. This function is easier to use than the low level, TABLE.CREATE_BEGIN(), TABLE.FIELD_ADD(), and TABLE.CREATE_END()methods. See TABLE.CREATE_BEGIN()for a list of valid field type codes.

Example

Create a new table.

fields = <<%a%
fname,c,20
lname,c,20
dob,d
notes,m
%a%
create_table("c:\data\newtable.dbf", fields)

See Also